﻿using Huirui.Cavan.Domain.Seedwork;
using System;
using System.Collections;

namespace Huirui.Cavan.Domain.MainBoundedContext.SystemModule
{
	#region SystemConfig

	/// <summary>
	/// SystemConfig object for NHibernate mapped table 'SystemConfig'.
	/// </summary>
    [Serializable]
	public class SystemConfig : Persistent
	{
		#region Member Variables

        protected SystemIdentifier.SystemConfigType _type;
		protected string _item;
		protected string _value;
        protected SystemIdentifier.DataType _dataType;
        protected string _description;
		protected string _remark;
        protected Corporation _corporation;

		#endregion

		#region Constructors

		public SystemConfig() { }

        public SystemConfig(SystemIdentifier.SystemConfigType type, string item, string value, SystemIdentifier.DataType dataType, string description, string remark, DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation)
		{
			this._type = type;
			this._item = item;
			this._value = value;
			this._dataType = dataType;
            this._description = description;
			this._remark = remark;
			this._createDate = createDate;
			this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
		}

		#endregion

		#region Public Properties

        public virtual SystemIdentifier.SystemConfigType Type
		{
			get { return _type; }
			set { _type = value; }
		}

		public virtual string Item
		{
			get { return _item; }
			set
			{
				if ( value != null && value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for Item", value, value.ToString());
				_item = value;
			}
		}

		public virtual string Value
		{
			get { return _value; }
			set
			{
				if ( value != null && value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for Value", value, value.ToString());
				_value = value;
			}
		}

        public virtual SystemIdentifier.DataType DataType
		{
			get { return _dataType; }
			set { _dataType = value; }
		}

        public virtual string Description
        {
            get { return _description; }
            set { _description = value; }
        }

		public virtual string Remark
		{
			get { return _remark; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for Remark", value, value.ToString());
				_remark = value;
			}
		}

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

		#endregion
	}
	#endregion
}